<?php
/**
 * Created by PhpStorm.
 * User: dong
 * Date: 2018/4/19
 * Time: 21:33
 */
namespace App\Services\ThirdPayments\BankTraits;

use App\Lib\BankMap;

trait AIISPAYBankMap
{
    private $bankMap = [
        BankMap::GONGSHANG  => BankMap::GONGSHANG,
        BankMap::NONGYE     => BankMap::NONGYE   ,
        BankMap::CHINABANK  => BankMap::CHINABANK,
        BankMap::JIANSHE    => BankMap::JIANSHE  ,
        BankMap::ZHAOSHANG  => BankMap::ZHAOSHANG,
        BankMap::PUFA       => BankMap::PUFA     ,
        BankMap::GUANGFA    => BankMap::GUANGFA  ,
        BankMap::JIAOTONG   => BankMap::JIAOTONG ,
        BankMap::YOUZHEN    => BankMap::YOUZHEN  ,
        BankMap::ZHONGXIN   => BankMap::ZHONGXIN ,
        BankMap::MINSHENG   => BankMap::MINSHENG ,
        BankMap::GUANGDA    => BankMap::GUANGDA  ,
        BankMap::HUAXIA     => BankMap::HUAXIA   ,
        BankMap::XINGYE     => BankMap::XINGYE   ,
        BankMap::SHANGHAI   => BankMap::SHANGHAI ,
        BankMap::PINGAN     => BankMap::PINGAN   ,
        BankMap::BEIJING    => BankMap::BEIJING
    ];

    public function getBank($bankCode)
    {
        if (array_key_exists($bankCode, $this->bankMap)) {
            return $this->bankMap[$bankCode];
        } else {
            return BankMap::GONGSHANG;
        }
    }
}